package io.renren.modules.bs.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.bs.entity.BsExtractDetailPatientHandleEntity;
import io.renren.modules.bs.service.BsExtractDetailPatientHandleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-08-15 23:03:14
 */
@RestController
@RequestMapping("bs/extractDetailPatientHandle")
public class BsExtractDetailPatientHandleController {
    @Autowired
    private BsExtractDetailPatientHandleService bsExtractDetailPatientHandleService;

    /**
     * 列表
     */
    @RequestMapping("/list")

    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = bsExtractDetailPatientHandleService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{extractDetailPatientHandleId}")

    public R info(@PathVariable("extractDetailPatientHandleId") Long extractDetailPatientHandleId){
		BsExtractDetailPatientHandleEntity bsExtractDetailPatientHandle = bsExtractDetailPatientHandleService.getById(extractDetailPatientHandleId);

        return R.ok().put("bsExtractDetailPatientHandle", bsExtractDetailPatientHandle);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")

    public R save(@RequestBody BsExtractDetailPatientHandleEntity bsExtractDetailPatientHandle){
		bsExtractDetailPatientHandleService.save(bsExtractDetailPatientHandle);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")

    public R update(@RequestBody BsExtractDetailPatientHandleEntity bsExtractDetailPatientHandle){
		bsExtractDetailPatientHandleService.updateById(bsExtractDetailPatientHandle);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")

    public R delete(@RequestBody Long[] extractDetailPatientHandleIds){
		bsExtractDetailPatientHandleService.removeByIds(Arrays.asList(extractDetailPatientHandleIds));

        return R.ok();
    }

}
